import request from "@/utils/request.js"

/**登录*/
export const login = (data) => request({
  url: '/login',
  method: 'post',
  data
})

/**获取函数列表*/
export const getToolFunList = (type) => request({
  url: '/getToolFunList',
  method: 'get',
  params: { type }
})

/**添加函数*/
export const addToolFun = (data) => request({
  url: '/addToolFun',
  method: 'post',
  data
})

/**编辑函数*/
export const editToolFun = (data) => request({
  url: '/editToolFun',
  method: 'post',
  data
})

/**删除函数*/
export const delToolFun = (data) => request({
  url: '/delToolFun',
  method: 'post',
  data
})


/**测试用*/
export const test = () => request({
  url: '/getStr',
  method: 'get',
})

/**上传文件*/
export const uploadFile = (data) => request({
  url: '/addFileItem',
  method: 'post',
  headers: {
    'Content-Type': 'multipart/form-data', // 设置 Content-Type 为 multipart/form-data
  },
  data
})

/**获取组件列表*/
export const getUiComponentsList = () => request({
  url: '/getUiComponentsList',
  method: 'get',
})
/**添加ui组件*/
export const addUiComponents = (data) => request({
  url: '/addUiComponents',
  method: 'post',
  data
})
/**
 * 删除UI组件
*/
export const deleteUiComponents = (data) => request({
  url: '/deleteUiComponents',
  method: 'post',
  data
})